package com.glqiang.controller;

import com.glqiang.domain.vo.LoginUserVo;
import com.glqiang.domain.vo.LoginVo;
import com.glqiang.domain.vo.MenuVo;
import com.glqiang.response.ResponseResult;
import com.glqiang.service.LoginService;
import com.glqiang.service.MenuService;
import com.glqiang.util.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Objects;

/**
 * @author glqiang
 * @date 2022/11/21 01:20
 */
@RestController
public class LoginController {
    @Autowired
    private LoginService loginService;

    @PostMapping("/login")
    public ResponseResult<LoginUserVo> login(@RequestBody LoginVo loginVo) {
        if (Objects.isNull(loginVo)) {
            return ResponseResult.error("登录参数不能为空");
        }
        return loginService.login(loginVo);
    }


}
